package com.wangmei.service.serviceimpl;

import com.wangmei.mapper.ProductkuidMapper;
import com.wangmei.model.Productkuid;
import com.wangmei.pojo.ProductkuidPojo;
import com.wangmei.service.ProductkuidService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class ProductkuidServiceImpl implements ProductkuidService {
    @Autowired
    private ProductkuidMapper productkuidMapper;

    @Override
    public int getProductStoreByPid(int pid){
        return productkuidMapper.getProductStoreByPid(pid);
    }

    @Override
    public Productkuid getProductStoreByPidVid(int pid,int vid){
        return productkuidMapper.getProductStoreByPidVid(pid,vid);
    }

    @Override
    public List<ProductkuidPojo> getProductkuidPojo(int pid) {
        return productkuidMapper.getProductkuidPojo(pid);
    }

    @Override
    public int updateProductkuidList(List<Productkuid> productkuidList) {
        return productkuidMapper.updateProductkuid(productkuidList);
    }

    @Override
    public int updateProductkuid(Productkuid productkuid) {
        return productkuidMapper.updateByPrimaryKeySelective(productkuid);
    }

    @Override
    public int deleteProductkuid(int kuid) {
        return productkuidMapper.deleteByPrimaryKey(kuid);
    }

    @Override
    public int addProductkuid(Productkuid productkuid) {
        return productkuidMapper.insertSelective(productkuid);
    }
}
